package test;


import org.junit.After;
import org.junit.Test;

import static org.junit.Assert.*;
import org.junit.Before;

import dsa.PostfixEvaluator;

public class GavinDavisPETest {

	@Before
	public void setUp() throws Exception {
		
		
	}

	@After
	public void tearDown() throws Exception {
		
		
	}
	
	@Test
	public void peEvalTest()
	{
		int answer = PostfixEvaluator.eval("5 5 * 10 2 / 5 * +");
		assertEquals(answer == 50, true);
		answer = PostfixEvaluator.eval("5 5 * 5 + 2 / 5 *");
		assertEquals(answer == 60, true);
		answer = PostfixEvaluator.eval("5 2 ^ 25 + 10 / 4 - 2 *");
		assertEquals(answer == 2, true);
		answer = PostfixEvaluator.eval("1 2 3 * + 5 2 / - = + 19 2 2 ^ / +");
		assertEquals(answer == 5, true);
		answer = PostfixEvaluator.eval("100 10 2 - 12 + 2 / * 4500 2 * +");
		assertEquals(answer == 10000, true);
		
		
	}

}
